Example: Get a Percentage-Based Statistic
This example demonstrates how to use a GET request to retrieve a percentage-based statistic.
For this example, we use the calls-answered-percent statistic.
Request
Sample Request
The request below returns the ratio of the number of accepted interactions to the total number of interactions:
curl GET https://api.cxengage.net/v1/tenants/7d23df20-2461-11e7-9bf4-b883f2d63b7b/realtime-statistics/calls-answered-percent
Request Parameters
The table below lists the parameters you can include in a request:
| Parameter | Required? |
Type
|
Description |
|---|---|---|---|
|
tenantId |
yes | UUID | The tenant's unique identifier. |
Response
Sample Response
The request returns JSON structured like the example below:
{
"results": {
"percent": 13.32,
"unit": "percentage",
"queryWindow": {
"start": "2017-07-04T03:00:00Z",
"end": "2017-07-05T02:59:59Z"
}
},
"queryTime": 10
}
Response Parameters
The response includes the following parameters:
| Parameter | Type | Description |
|---|---|---|
| percent | string | The ratio that represents the relationship between two measures, multiplied by 100. |
| unit | string |
How the value is measured. In this case, |
| queryWindow | object |
A JSON object containing the following parameters:
|
| queryTime | string |
The length of time, in milliseconds, that it took for the API to respond to the call. |